import { request } from '../../request'

/**
 * 获取素材分页列表
 * @param params - 查询参数
 */
export function fetchMaterialList(params?: ApiModels.weixin.MaterialQueryType) {
  return request.get<ApiModels.PageList<ApiModels.weixin.Material>>('/weixin/Materials/list', { params })
}

/**
 * 获取素材详情
 * @param mediaid - 素材id
 */
export function fetchMaterialDetail(mediaid: string) {
  return request.get<string>(`/weixin/Materials/get?mediaid=${mediaid}`)
}

/**
 * 删除素材
 * @param mediaid - 素材id
 */
export function deleteMaterial(mediaid: string) {
  return request.delete<ApiModels.weixin.Material>(`/weixin/Materials/delete?mediaid=${mediaid}`)
}
